package com.cn.xiaonuo.slbfinances.stockcontrol.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.slbfinances.stockcontrol.param.InventoryChangeLogParam;
import com.cn.xiaonuo.slbfinances.stockcontrol.param.PageExclusiveShopParam;
import com.cn.xiaonuo.slbfinances.stockcontrol.param.PageStockLogParam;
import com.cn.xiaonuo.slbfinances.stockcontrol.service.SlShopStockControlService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @BelongsProject: slb-reports-java
 * @Author: likui
 * @CreateTime: 2023-01-10  15:10
 * @Description: 共享商品库存管理
 */
@RestController
public class SharedGoodsStockController {

    @Autowired
    private SlShopStockControlService slShopStockControlService;

    @ApiOperation(value = "搜了宝--库存管理定时统计", notes = "搜了宝--库存管理定时统计")
    @PostMapping("/api/common/sharedGoodsStock/regularStockStatistics")
    public BusinessMessage regularStockStatistics(){
        return slShopStockControlService.regularStockStatistics();
    }

    @ApiOperation(value = "搜了宝--专卖店库存查询", notes = "搜了宝--专卖店库存查询")
    @PostMapping("/api/sharedGoodsStock/PageExclusiveShop")
    public BusinessMessage PageExclusiveShop(@RequestBody PageExclusiveShopParam param) throws ParseException {
        return slShopStockControlService.PageExclusiveShop(param);
    }
    @ApiOperation(value = "搜了宝--专卖店库存流水列表", notes = "搜了宝--专卖店库存流水列表")
    @PostMapping("/api/sharedGoodsStock/PageStockLog")
    public BusinessMessage PageStockLog(@RequestBody PageStockLogParam param) throws ParseException {
        return slShopStockControlService.PageStockLog(param);
    }

    @ApiOperation(value = "搜了宝--专卖店出入库流水记录", notes = "搜了宝--专卖店出入库流水记录")
    @PostMapping("/api/sharedGoodsStock/inventoryChangeLog")
    public BusinessMessage inventoryChangeLog(@RequestBody InventoryChangeLogParam param){
        return slShopStockControlService.inventoryChangeLog(param);
    }

}
